<template>
  <div class="search">
    <div class="btn-btm">
      <el-button v-if="showAdd" type="primary" plain size="mini"
                 icon="el-icon-plus" @click="handleAdd">{{addTitle}}</el-button>
      <el-button type="success" size="mini" v-if="examineShow"
                 @click="throughAdd">{{throughTitle}}</el-button>
      <el-button type="warning" size="mini" v-if="examineShow"
                 @click="refusedAdd">{{refusedTitle}}</el-button>
    </div>
    <div class="btn-btm">
      <el-button v-if="showSearch" plain size="small" circle icon="el-icon-search" @click="isSearch"></el-button>
      <el-button plain size="small" circle icon="el-icon-refresh" @click="creRefresh"></el-button>
      <el-button type="primary" circle size="small" icon="el-icon-set-up" @click="setFilter"></el-button>
    </div>
  </div>
</template>

<script>
  export default {
    name: "headerSearch",
    props: {
      addTitle: {
        type: String,
        default: '添加'
      },
      showAdd: {
        type: Boolean,
        default: true
      },
      throughTitle: {
        type: String,
        default: '通过'
      },
      refusedTitle: {
        type: String,
        default: '拒绝'
      },
      examineShow: {
        type: Boolean,
        default: false
      },
      showSearch: {
        type: Boolean,
        default: true
      }
    },
    methods: {
      handleAdd(){
        this.$emit('handleAdd')
      },
      isSearch() {
        this.$emit('isSearch')
      },
      creRefresh() {
        this.$emit('creRefresh')
      },
      setFilter() {
        this.$emit('setFilter')
      },
      throughAdd() { this.$emit('throughAdd') },
      refusedAdd() { this.$emit('refusedAdd') }
    }
  }
</script>

<style scoped>
.search {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
</style>
